package com.example.inventoryservice.company;

import java.math.BigDecimal;

// 税收计算结果模型
public class  TaxCalculationResult {

    private BigDecimal taxableIncome; // 应纳税所得额
    private BigDecimal taxRate; // 适用税率
    private BigDecimal baseTax; // 基准税额
    private BigDecimal deductions; // 减免税额
    private BigDecimal finalTaxAmount; // 最终应纳税额
    private BigDecimal prepaidTax; // 已预缴税额
    private BigDecimal taxToPay; // 应补(退)税额

    // 构造函数、getter和setter省略
    public TaxCalculationResult(BigDecimal taxableIncome, BigDecimal taxRate, BigDecimal baseTax, BigDecimal deductions, BigDecimal finalTaxAmount, BigDecimal prepaidTax) {
        this.taxableIncome = taxableIncome;
        this.taxRate = taxRate;
        this.baseTax = baseTax;
        this.deductions = deductions;
        this.finalTaxAmount = finalTaxAmount;
        this.prepaidTax = prepaidTax;
        this.taxToPay = finalTaxAmount.subtract(prepaidTax);
    }

    @Override
    public String toString() {
        return String.format("应纳税所得额: %s, 适用税率: %s%%, 基准税额: %s, 减免税额: %s, 最终应纳税额: %s, 已预缴: %s, 应补(退): %s", taxableIncome, taxRate.multiply(new BigDecimal("100")), baseTax, deductions, finalTaxAmount, prepaidTax, taxToPay);
    }
}
